import os
with open("./build/Homework.tex", encoding="utf-8") as fr, open("./build/Homework.bak", 'w', encoding="utf-8") as fw:
    k = 0
    for line in fr:
        if k==0:
            newline = line.replace('article','ctexart')
            k = 1
        else:
            newline = line
        fw.write(newline)
os.remove('./build/Homework.tex')
os.rename('./build/Homework.bak', './build/Homework.tex')